# Emacs config needs

- geiser
- paredit
- CJ's random keybindings and functions


- switching evil on and off
- (keybindings issue when using the terminal)

Jorge:

- evil
- lispy
- lispyville
- rainbow delimiters


```scheme
(specification->manifest
  '("emacs-geiser"
    "emacs-paredit"
    "emacs-evil"
    "emacs"
    "emacs-lispyville")
```

```scheme
guix system reconfigure /etc/myconfig.scm
```

## VNC

### Server side

#### Setup

As root:

* dpkg -i vnc4server_4.1.1+X4.3.0-37.1_amd64.deb
* apt-get install xfce4



Also, decide on a user which will run the vnc server, $VNCUSER (which is also the user that will run the whole remote desktop including emacs). And a user that will allow others ssh login, $SSHUSER. Those can be the *same* user unless there's a need to try to avoid others to log in to a shell directly (those people can always try to use the vnc session for nefarious purposes).

As $VNCUSER:

```sh
    cat > .vnc/xstartup
    #!/bin/sh
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    xsetroot -solid grey
    vncconfig -iconic &
    #x-window-manager &
    #term
    emacs --fullscreen
```

Then

    chmod +x .vnc/xstartup

#### Start the vnc server

    vncserver :1 -geometry 1150x760

#### Stop the vnc server

    killall Xvnc4


#### Make a login without shell

This is if you want a separate locked-down $SSHUSER.

    adduser   --shell=/bin/true --disabled-password  christian


#### In either case

As $SSHUSER (which might be the same as $VNCUSER):

- put ssh public key into ~/.ssh/authorized_keys

```sh
umask 077; mkdir .ssh; cat > .ssh/authorized_keys # paste key, then ctl-d
```

```sh
cat > .ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDhjaK5eG211qk2WbZgeMQNjIbpqVaR8B24Ji/fo4xp+XZ9e538jAjpz9xrOgADwVjb9U8djh44MNn6CrESRx7vWAVRxE2tnMo4sHa2j8xzU6Amth9fmrRqwPwwXZNOW/av2TrrB7/pTkHDzTs9N/Pcms6FPDhnTDhKLNt1eH+JGVKlmnObhsFrviQqASF1+LBl6ZuDpElJ14tQudzKIiBhU8yRPGBrYLFzL1pwGHivHNZ7Mtih6NikeBx2dCReWAqeSCS6oqZq84uBlGaIZh4AyzCZ+SSkQOZzaAHIaaTkIldPVMv8Gsc1ZMEUf72C1U+l1qjhAlr9+5zNDm+ZK3dl rustaceans@dull
``` 


 r w x
 4 2 1
 072
 2 - world does not have write permission

```sh
umask 073; # 2 + 1
```

### Client side (Linux)

#### One-time

As root:

    apt-get install xtightvncviewer

As your normal daily user:

- make an ssh public key if you don't have one already:

        ssh-keygen

        cat ~/.ssh/id_rsa.pub

- copy over the `passwd` file from the vnc server (if it's not on the
  server, see `man vnc4passwd`):

        ( umask 077; mkdir ~/.vncclient-passwords/ )
        scp $VNCUSER@$YOURSERVER:.vnc/passwd ~/.vncclient-passwords/


#### ssh tunneling

(As your normal daily user.)

Make a script `yourserver-tunnel` in your ~/bin/ directory or any place you have in your `$PATH`

    ssh -N \
        -L5901:localhost:5901 \
        yourserver

Each time you want to connect to the remote VNC session, run that
script you made above, then run:

    xvncviewer -FullScreen -MenuKey F7 -shared -passwd ~/.vncclient-passwords/passwd localhost:1


## Other

```scheme
(services
(service mentoring-service-type
    ;; ssh-tunnel-service-type ;; 
    xorg-service-type
    sshd-service-type))
```

